home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / windows / lfnsrt13.zip / LFNSORT.TXT < prev   
Text File  |  1996-08-22  |  21KB  |  463 lines

  1. LFNSORT v 1.3 - Sorts DOS/Win95 directories
  2.  
  3. Copyright (c) 1995,1996 D.J. Murdoch.
  4.  
  5. 0. Contents of this file
  6.  
  7.    1. Syntax
  8.    2. Description
  9.    3. Details
  10.    4. Memory Limitations
  11.    5. Safety
  12.    6. License
  13.    7. Release History
  14.    8. Known bugs
  15.    9. Acknowledgments
  16.  
  17. 1. Syntax:
  18.  
  19.       LFNSORT sortkeys [dirname] [options]
  20.  
  21.         will sort the directory records on disk according to the
  22.         specified sort keys.
  23.  
  24.       Keys:
  25.         N - full filename
  26.         E - extension
  27.         D - last modification date
  28.         T - last modification time
  29.         C - creation date/time
  30.         A - last access date/time
  31.         S - size
  32.  
  33.         Place a "-" minus sign in front of a key to sort in descending
  34.         order instead of ascending order.  Keys can be combined, e.g.
  35.         "-DN" for "sorted by descending modification date, and by
  36.         ascending name within date".  Use "-" by itself as a placeholder
  37.         if you want no sort key.
  38.  
  39.       Options:
  40.         /8       base sort order on 8.3 version of names instead of long
  41.                  names
  42.         /C       case sensitive sort - ascii sort order
  43.         /D       mix directories in with files
  44.         /Debug file  write debug information to file
  45.         /F filename  read forced sort order from file (see below for
  46.                  syntax and examples
  47.         /K       keep erased entries, and keep directory at original
  48.                  size, even if not all space is used
  49.         /NW      no write - changes won't be saved to disk
  50.         /S       sort subdirectories recursively
  51.         /System  don't sort system files first in the root dir
  52.         /V       verbose mode; list all directories and filenames after
  53.                  sorting
  54.  
  55.       Examples:
  56.  
  57.         To sort every subdirectory on drive C: by file extension then
  58.         filename:
  59.  
  60.           LFNSORT en c:\ /s
  61.  
  62.         To sort every directory on drive C: so that most recently
  63.         accessed files come first:
  64.  
  65.           LFNSORT -a-d-t c:\ /s
  66.  
  67.         (The "-d-t" is necessary because not all directory records
  68.         include an access time; older ones and ones created in DOS mode
  69.         will only have a modification time.)
  70.  
  71. 2. Description:
  72.  
  73.         The original Norton Utilities had a program called DS which
  74.         could sort your DOS directories according to your preferences.
  75.         Later versions added a graphical interface so you could manually
  76.         move files around.
  77.  
  78.         When Win95 came out with the VFAT long filenames, DS stopped
  79.         working.  It hadn't been written to handle the new directory
  80.         records.  Symantec (the current owners of the Norton Utilities)
  81.         haven't produced a new version of DS as far as I know, so when
  82.         Jacques Bensimon suggested that a minor modification to my
  83.         long filename backup utility DOSLFNBK could do directory sorts,
  84.         I decided that I wanted DS badly enough to write it myself.
  85.         There is already at least one freeware/shareware utility called
  86.         DIRSORT, so I called mine LFNSORT.
  87.  
  88. 3. Details:
  89.  
  90.       Disk locking:
  91.  
  92.         LFNSORT works on the disk drive at a pretty low level.  To be
  93.         allowed this access, it requests exclusive access to the drive
  94.         from Windows.  If another program has already requested
  95.         exclusive access, LFNSORT will exit and do nothing.  While
  96.         LFNSORT is running, other programs will not be allowed to write
  97.         to the disk or to create new files.  This may confuse them; it's
  98.         probably best not to attempt any other disk activity in the
  99.         middle of an LFNSORT run.  (LFNSORT has been written according to
  100.         Microsoft's instructions to work without damaging your disk even
  101.         if another program attempts access, but the other program might
  102.         not be.)
  103.  
  104.         LFNSORT handles the disk locking itself.  In fact, if you use
  105.         the LOCK command to lock the drive, LFNSORT will be unable to
  106.         obtain a lock, and will not run.
  107.  
  108.         If you run LFNSORT under DOS, or in a version of Windows that
  109.         doesn't support drive locking, it will still run.  If it detects
  110.         Windows it will warn you that running in a multitasker without
  111.         protecting the disk from changes is dangerous, and will only
  112.         go ahead if you confirm you really mean it.  If it doesn't detect
  113.         Windows, it will assume that it is safe to go ahead --- so if
  114.         you're using another multitasker like Desqview, use it with
  115.         extreme care!
  116.  
  117.       Forcing a particular order:
  118.  
  119.         The /F option takes a plain ascii file as an argument.  This
  120.         file should have the following format:
  121.  
  122.            \directory1
  123.            firstfile
  124.            secondfile
  125.            thirdfile
  126.  
  127.            \directory2
  128.            afile
  129.            bfile
  130.            cfile
  131.  
  132.         Specifically:  any line with a backslash "\" in it is taken as a
  133.         directory name, any other non-blank line is taken as a filename.
  134.  
  135.         These will force the files in directory1 and directory2 into the
  136.         order given.  If a file isn't listed, it will normally appear
  137.         *after* all the listed files.  However, you can override this by
  138.         putting a "*" entry in place of a file; then all unlisted files
  139.         will be placed there.  For example,
  140.  
  141.           \directory
  142.           firstfile
  143.           *
  144.           lastfile
  145.  
  146.         will guarantee the placement of those two files, but sort
  147.         everything else according to the specified sort keys.  (Hint:
  148.         if you want to use the file to specify part of the order but
  149.         make no other changes, use "-" as a sort key.)
  150.  
  151.         The order in which the directory sections appear in this file is
  152.         ignored. If you want directories in a particular order, list
  153.         them in a section for their parent directory. If you don't
  154.         specify any directory name, the ordering is used as a default
  155.         for unlisted directories. For example, to put README.1ST
  156.         files first in every directory where they exist, put a single
  157.         line containing "README.1ST" into a file called FORCED.LST, and
  158.         run
  159.  
  160.           LFNSORT - c:\ /f forced.lst
  161.  
  162.         File and directory names in this file may normally be either 8.3
  163.         aliases or long filenames, but if you're running outside Windows
  164.         where there is no long filename support, you *must* use the 8.3
  165.         alias.
  166.  
  167.         If you want to force the file order for a large collection of
  168.         directories, you can use the /V option to create a preliminary
  169.         version of the forcing file.  For example,
  170.  
  171.           LFNSORT - c:\ /D/System/NW/S/V >new.lst
  172.  
  173.         will write a list of the files in their current order
  174.         into the "new.lst" file.  The - specifies no sorting, and the
  175.         /D and /System options turn off the default actions for
  176.         directories and system files.
  177.  
  178.       Moving system files:
  179.  
  180.         Normally the root directory of your boot drive has IO.SYS first,
  181.         and MSDOS.SYS in the second place.  As long as these are left
  182.         with the System and Hidden attributes set, LFNSORT won't move
  183.         them.  However, if you accidentally move them and want to
  184.         restore them to the start of the directory (because some
  185.         versions of DOS won't boot if they get moved):
  186.  
  187.         Put these two lines in a file called FORCED.LST:
  188.  
  189.           IO.SYS
  190.           MSDOS.SYS
  191.  
  192.         and run
  193.  
  194.           LFNSORT - c:\ /F forced.lst /System /D
  195.  
  196.       Volume labels:
  197.  
  198.         Pre-7.0 versions of DOS can be confused by long filename
  199.         records, which look to them like volume labels.  This can be
  200.         fixed by putting the volume label before any long filenames in
  201.         the directory, but the Win95 LABEL command doesn't do this.
  202.         LFNSORT fixes this, unless you use the /System option, in which
  203.         case the volume label will be sorted like a file record.  Don't
  204.         put the volume label ahead of your boot files, if you want your
  205.         disk to be boot